chore(node-client): Implement NodeClient and createClient entry point#1416
chore(node-client): Implement NodeClient and createClient entry point#1416joker23 wants to merge 5 commits into
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ac79085. Configure here.
| // preventing a stale reject from firing if setConnectionMode runs after resolution. | ||
| const wrappedResolve = identifyResolve | ||
| ? () => { | ||
| this._pendingIdentifyReject = undefined; |
There was a problem hiding this comment.
I am going to leave this in as a way to handle the edge case described in the comments... I do think that we can get rid of this handling and just let the previous identify timeout or be shedded.
b3127f2 to
ad986dd
Compare
|
|
||
| // Serializes connection-mode transitions so concurrent calls cannot leave event-sending | ||
| // state out of sync with the active connection mode. | ||
| private _connectionModeQueue: Promise<void> = Promise.resolve(); |
There was a problem hiding this comment.
This feels like it would be inside the data manager.
put in the for ordering
fixing up the race conditions that could happen when connection mode is changed during identify
fb90a0c to
095b0fc
Compare
This PR will:
Note
Medium Risk
New SDK surface affecting flag loading, streaming/polling, and identify timing; logic is heavily tested but changes core client initialization and connection behavior.
Overview
Implements the functional
@launchdarkly/node-client-sdkpackage by replacing the placeholder entry point withcreateClient,NodeClient(on sharedLDClientImpl), andNodeDataManagerfor streaming/polling/offline, bootstrap, and identify lifecycle.NodeDataManagerapplies bootstrap without reading cache, can open streaming/polling after bootstrap without tying identify to the network, serializessetConnectionMode, and rejects in-flight identify on close, offline, or mode switches so callers do not hang on timeouts.NodeClientwires connection mode to flush/event sending and defaults identify to sheddable.The package
indexnow documents and exports the public API; release-please no longer bumps version inindex.ts. Broad Jest coverage uses a mock platform for data sources, bootstrap, events, and races.Reviewed by Cursor Bugbot for commit 095b0fc. Bugbot is set up for automated code reviews on this repo. Configure here.